//信用账户
public class CreditAccount extends Account {

	private int CreditAccount=1;
	private double ceiling;//透支额度
	private String CardName="信用卡";
	
	public CreditAccount(int id, String password, String name, String personId, String email, double balance,double ceiling) {
		super(id, password, name, personId, email, balance);
		this.ceiling=ceiling;
	}

	
	


	public double getCeiling() {
		return ceiling;
	}


	public void setCeiling(double ceiling) {
		this.ceiling = ceiling;
	}


	
	
	public void  withdraw(double qk){
		if (getBalance()-qk+ceiling>=0) {
			
			setBalance(getBalance()-qk);	
			
		}else {
			System.out.println("余额不足");
		}
	
		
	}







	@Override
	public String toString() {
		return "Account{" +
				"id=" + getId() +
				", password='" + getPassword() + '\'' +
				", name='" + getName() + '\'' +
				", personId='" + getPersonId() + '\'' +
				", email='" + getEmail() + '\'' +
				", balance=" + getBalance() + '\'' +
				", 当前卡为="+ CardName+'\'' +
				", 透支额度="+ ceiling+
				'}';
	}













}
